home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / binutils.7 / binutils / binutils-2.7 / ld / testsuite / ld-scripts / script.exp < prev    next >
Encoding:
Text File  |  1996-07-04  |  1.7 KB  |  65 lines

  1. # Test basic linker script functionality
  2. # By Ian Lance Taylor, Cygnus Support
  3.  
  4. set testname "script"
  5.  
  6. if ![ld_assemble $as $srcdir$subdir/script.s tmpdir/script.o] { 
  7.     unresolved $testname
  8.     return
  9. }
  10.  
  11. proc check_script { } {
  12.     global nm
  13.     global testname
  14.     global nm_output
  15.  
  16.     if ![ld_nm $nm tmpdir/script] {
  17.     unresolved $testname
  18.     } else {
  19.     if {![info exists nm_output(text_start)] \
  20.          || ![info exists nm_output(text_end)] \
  21.          || ![info exists nm_output(data_start)] \
  22.          || ![info exists nm_output(data_end)]} {
  23.         send_log "bad output from nm\n"
  24.         verbose "bad output from nm"
  25.         fail $testname
  26.     } else {
  27.         if {$nm_output(text_start) != 0x100} {
  28.         send_log "text_start == $nm_output(text_start)\n"
  29.         verbose "text_start == $nm_output(text_start)"
  30.         fail $testname
  31.         } else { if {$nm_output(text_end) < 0x104 \
  32.               || $nm_output(text_end) > 0x110} {
  33.         send_log "text_end == $nm_output(text_end)\n"
  34.         verbose "text_end == $nm_output(text_end)"
  35.         fail $testname
  36.         } else { if {$nm_output(data_start) != 0x1000} {
  37.         send_log "data_start == $nm_output(data_start)\n"
  38.         verbose "data_start == $nm_output(data_start)"
  39.         fail $testname
  40.         } else { if {$nm_output(data_end) < 0x1004 \
  41.              || $nm_output(data_end) > 0x1010} {
  42.         send_log "data_end == $nm_output(data_end)\n"
  43.         verbose "data_end == $nm_output(data_end)"
  44.         fail $testname
  45.         } else {
  46.         pass $testname
  47.         } } } }
  48.     }
  49.     }
  50. }
  51.  
  52. if ![ld_simple_link $ld tmpdir/script "-T $srcdir$subdir/script.t tmpdir/script.o"] {
  53.     fail $testname
  54. } else {
  55.     check_script
  56. }
  57.  
  58. set testname "MRI script"
  59.  
  60. if ![ld_simple_link $ld tmpdir/script "-c $srcdir$subdir/scriptm.t"] {
  61.     fail $testname
  62. } else {
  63.     check_script
  64. }
  65.